<?php
namespace app\controllers;

use app\models\SetRecorder;
use yii\web\Controller;

class BaseController extends Controller{
    public $enableCsrfValidation = false;
    public $user;

    public function beforeAction($action)
    {
        if(!file_exists('../data/install.lock')){
            $result = "请在浏览器输入 你的域名/install.php 安装";
            echo $result;
            return false;
        }
        if(\Yii::$app->user->isGuest){
            $result = ['result'=>'login_error','data'=>'请先登录'];
            echo json_encode($result);
            return false;
        }
        $set = SetRecorder::find()->where('set_id=1')->one();
        $arr = json_decode($set->set_info,true);
        \Yii::$app->params=array_merge(\Yii::$app->params,$arr);
        return parent::beforeAction($action); // TODO: Change the autogenerated stub
    }



}
